package com.example.springbootredis.service.impl;

import com.example.springbootredis.entity.ApiAccount;
import com.example.springbootredis.repository.ApiAccountRepository;
import com.example.springbootredis.service.ApiAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApiAccountServiceImpl implements ApiAccountService {
    @Autowired
    private ApiAccountRepository apiAccountRepository;
    @Override
    public int addApiAccount(ApiAccount apiAccount) {
        return apiAccountRepository.save(apiAccount).getId();
    }

    @Override
    public ApiAccount findByAccount(String account) {
        return apiAccountRepository.findByAccount(account);
    }

    @Override
    public ApiAccount findByPhone(String phone) {
        return apiAccountRepository.findByPhone(phone);
    }
}